package com.net.xpay.common.domain.partner;

import com.net.common.domain.VersionedDomain;
import com.net.xpay.common.enums.partner.WithdrawStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 合伙人提现记录
 *
 * @author anno
 */
@Getter
@Setter
@NoArgsConstructor
public class PartnerWithdrawRecord extends VersionedDomain {
    @ApiModelProperty(notes = "合伙人编号")
    private Long partnerId;

    @ApiModelProperty(notes = "支付状态")
    private WithdrawStatus status;

    @ApiModelProperty(notes = "线下转账")
    private Integer isOffline;

    @ApiModelProperty(notes = "支付宝实名")
    private String alipayName;

    @ApiModelProperty(notes = "支付宝收款账号")
    private String alipayAccount;

    //金额相关字段
    @ApiModelProperty(notes = "转账金额")
    private Long transferMoney;

    @ApiModelProperty(notes = "系统转账时间或者关闭时间")
    private LocalDateTime endTime;

    @ApiModelProperty(notes = "备注")
    private String remark;

    public static PartnerWithdrawRecord getInstance(Long partnerId, Long transferMoney) {
        PartnerWithdrawRecord instance = new PartnerWithdrawRecord();
        instance.setPartnerId(partnerId);
        instance.setStatus(WithdrawStatus.WAIT_PAY);
        instance.setIsOffline(0);
        instance.setTransferMoney(transferMoney);
        return instance;
    }
}
